import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    cors: true, 	// 默认启用并允许任何源
    open: false, 	// 在服务器启动时自动在浏览器中打开应用程序
    port: 3000,
    proxy: {
      '/api': {
        target: 'http://localhost:8082/dem1',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    },
  }
})
